﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using Portfolio.Entities;
using Portfolio.Repository.Common;
using Portfolio.Repository.Interfaces;

namespace Portfolio.Repository.Menu
{
    public class MenuRepository : GenericRepository, IMenuRepository
    {
        public MenuRepository(ObjectContext context) : base(context) { }
        
        public IList<MenuTopView> GetMenuItemsByActiveFlag()
        {            
            return GetAll<MenuTopView>().ToList();
        }

        public MenuTopArticleV GetArticleByMenuItem(int menuItemID)
        {
            return Single<MenuTopArticleV>(c => c.MenuItemID == menuItemID);
        }
    }
}
